<template>
<!--項目立項-->
  <div class="xmlx">
    <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="60px">
      <el-row style="margin-top: 25px">
        <el-col :span="6">
          <el-form-item label="申请人：" label-width="90px">
            <el-input v-model="ruleForm.shenbaoren" placeholder="请输入" suffix-icon="el-icon-user"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="申请日期：" label-width="90px">
            <el-date-picker
              v-model="ruleForm.riqi"
              type="date"
              placeholder="选择日期"
              style="width: 100%">
            </el-date-picker>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="申请部门：" label-width="90px">
            <el-input v-model="ruleForm.bumen" placeholder="请输入" suffix-icon="el-icon-c-scale-to-original"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="N：">
            <el-input v-model="ruleForm.N" placeholder="请输入"></el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-form-item label="申请单位：" label-width="90px">
          <el-input v-model="ruleForm.danwei" placeholder="请输入" suffix-icon="el-icon-office-building"></el-input>
        </el-form-item>
      </el-row>
      <el-row>
        <el-tabs v-model="activeName" type="card" @tab-click="handleClick">
          <el-tab-pane label="基本信息" name="first">
            <div class="form-small-title">
              <el-divider direction="vertical" class="form-divider"></el-divider>
              <span class="form-small-font">基本信息</span>
            </div>
            <el-row style="margin-top: 25px">
              <el-col :span="12">
                <el-form-item label="项目名称：" label-width="100px">
                  <el-input v-model="ruleForm.xmmc" placeholder="请输入" suffix-icon="el-icon-user"></el-input>
                </el-form-item>
              </el-col>
              <el-col :span="6">
                <el-form-item label="项目编号：" label-width="90px">
                  <el-input v-model="ruleForm.xmbh" placeholder="请输入" suffix-icon="el-icon-user"></el-input>
                </el-form-item>
              </el-col>
              <el-col :span="6">
                <el-form-item label="项目类型：" label-width="90px">
                  <el-select v-model="ruleForm.xmlx" placeholder="请选择" style="width: 100%">
                    <el-option v-for="item in projectTypeOptions" :key="item.value" :label="item.label" :value="item.value"></el-option>
                  </el-select>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="6">
                <el-form-item label="负责人：" label-width="100px">
                  <el-input v-model="ruleForm.fzr" placeholder="请输入" suffix-icon="el-icon-user"></el-input>
                </el-form-item>
              </el-col>
              <el-col :span="6">
                <el-form-item label="项目部门：" label-width="90px">
                  <el-input v-model="ruleForm.xmbm" placeholder="请输入" suffix-icon="el-icon-c-scale-to-original"></el-input>
                </el-form-item>
              </el-col>
              <el-col :span="6">
                <el-form-item label="资金来源：" label-width="90px">
                  <el-select v-model="ruleForm.zjly" placeholder="请选择" style="width: 100%">
                    <el-option v-for="item in capitalSourceOptions" :key="item.value" :label="item.label" :value="item.value"></el-option>
                  </el-select>
                </el-form-item>
              </el-col>
              <el-col :span="6">
                <el-form-item label="投资估算：" label-width="90px">
                  <el-input v-model="ruleForm.tzgs" placeholder="请输入">
                    <template slot="append">元</template>
                  </el-input>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="6">
                <el-form-item label="计划开始：" label-width="100px">
                  <el-date-picker
                    v-model="ruleForm.jhks"
                    type="date"
                    placeholder="选择日期"
                    style="width: 100%">
                  </el-date-picker>
                </el-form-item>
              </el-col>
              <el-col :span="6">
                <el-form-item label="计划完成：" label-width="90px">
                  <el-date-picker
                    v-model="ruleForm.jhwc"
                    type="date"
                    placeholder="选择日期"
                    style="width: 100%">
                  </el-date-picker>
                </el-form-item>
              </el-col>
              <el-col :span="6">
                <el-form-item label="计划工期：" label-width="90px">
                   <el-input v-model="ruleForm.jhgq" placeholder="请输入">
                    <template slot="append">天(自然日)</template>
                  </el-input>
                </el-form-item>
              </el-col>
              <el-col :span="6">
                <el-form-item label="预计收入：" label-width="90px">
                  <el-input v-model="ruleForm.yjsr" placeholder="请输入">
                    <template slot="append">元</template>
                  </el-input>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-form-item label="事由及说明：" label-width="100px">
                <el-input v-model="ruleForm.shiyou" placeholder="请输入"></el-input>
              </el-form-item>
            </el-row>
            <el-row>
              <el-form-item label="项目目标：" label-width="100px">
                <el-input v-model="ruleForm.xmmb" placeholder="请输入"></el-input>
              </el-form-item>
            </el-row>
            <el-row>
              <el-form-item label="预期成果：" label-width="100px">
                <el-input v-model="ruleForm.yqcg" placeholder="请输入" ></el-input>
              </el-form-item>
            </el-row>
            <el-row>
              <el-col :span="12">
                <el-form-item label="可研报告：" label-width="100px">
                  <el-input v-model="ruleForm.kybg" placeholder="请输入" suffix-icon="el-icon-paperclip"></el-input>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item label="相关附件：" label-width="90px">
                  <el-input v-model="ruleForm.fujian" placeholder="请输入" suffix-icon="el-icon-paperclip"></el-input>
                </el-form-item>
              </el-col>
            </el-row>
            <div class="form-small-title">
              <el-divider direction="vertical" class="form-divider"></el-divider>
              <span class="form-small-font">审批意见</span>
            </div>
            <el-row style="margin-top: 25px">
              <el-input
                type="textarea"
                :rows="2"
                placeholder="请输入"
                v-model="ruleForm.approval">
              </el-input>
            </el-row>
          </el-tab-pane>
          <el-tab-pane label="团队成员" name="second">
            <div class="form-small-title">
              <el-divider direction="vertical" class="form-divider"></el-divider>
              <span class="form-small-font">团队成员</span>
            </div>
            <el-row>
              <form-table tableState="xmlx" :tableColumns="tableColumns" :tableData="tableData" :defaultData="defaultData"></form-table>
            </el-row>
            <div class="form-small-title" style="margin-top: 25px">
              <el-divider direction="vertical" class="form-divider"></el-divider>
              <span class="form-small-font">审批意见</span>
            </div>
            <el-row style="margin-top: 25px">
              <el-input
                type="textarea"
                :rows="2"
                placeholder="请输入"
                v-model="ruleForm.approval">
              </el-input>
            </el-row>
          </el-tab-pane>
          <el-tab-pane label="收款合同" name="third">
            <div class="form-small-title">
              <el-divider direction="vertical" class="form-divider"></el-divider>
              <span class="form-small-font">合同信息</span>
            </div>
            <el-row style="margin-top: 25px">
              <el-col :span="12">
                <el-form-item label="合同名称：" prop="contractName" label-width="90px">
                  <el-input v-model="ruleForm.contractName" placeholder="请输入"></el-input>
                </el-form-item>
              </el-col>
              <el-col :span="6">
                <el-form-item label="合同编号：" prop="contractNumber" label-width="90px" >
                  <el-input v-model="ruleForm.contractNumber" placeholder="请输入"></el-input>
                </el-form-item>
              </el-col>
              <el-col :span="6">
                <el-form-item label="合同金额：" prop="contractFee" label-width="90px">
                  <el-input v-model="ruleForm.contractFee" placeholder="请输入"></el-input>
                </el-form-item>
              </el-col>
            </el-row>
            <div class="form-small-title">
              <el-divider direction="vertical" class="form-divider"></el-divider>
              <span class="form-small-font">客户信息</span>
            </div>
            <el-row style="margin-top: 25px">
              <el-col :span="12">
                <el-form-item label="客户名称：" prop="customerName" label-width="90px">
                  <el-input v-model="ruleForm.customerName" placeholder="请输入" ></el-input>
                </el-form-item>
              </el-col>
              <el-col :span="6">
                <el-form-item label="客户编码：" prop="customerCode" label-width="90px">
                  <el-input v-model="ruleForm.customerCode" placeholder="请输入" ></el-input>
                </el-form-item>
              </el-col>
              <el-col :span="6">
                <el-form-item label="法人代表：" prop="representative" label-width="90px">
                  <el-input v-model="ruleForm.representative" placeholder="请输入"></el-input>
                </el-form-item>
              </el-col>
            </el-row>
            <div class="form-small-title">
              <el-divider direction="vertical" class="form-divider"></el-divider>
              <span class="form-small-font">审批意见</span>
            </div>
            <el-row style="margin-top: 25px">
              <el-input
                type="textarea"
                :rows="2"
                placeholder="请输入"
                v-model="ruleForm.approval">
              </el-input>
            </el-row>
          </el-tab-pane>
        </el-tabs>
      </el-row>
    </el-form>
  </div>
</template>

<script>
import FormTable from "@/views/leader/components/formTable";
export default {
  name: "xmlx",
  components: {FormTable},
  data(){
    return{
      ruleForm:{},
      rules:{},
      activeName:'first',
      projectTypeOptions:[],
      capitalSourceOptions:[],
      tableColumns:[
        { prop: 'xingming', label: '姓名', align: 'center', type:'input' },
        { prop: 'bumen', label: '部门', align: 'center', type:'input' },
        { prop: 'xmjs', label: '项目角色', align: 'center', type:'input' },
        { prop: 'lxdh', label: '联系电话', align: 'center', type:'input' },
        { prop: 'zrsm', label: '责任说明', align: 'center', type:'input' },
      ],
      defaultData:['xingming','bumen','xmjs','lxdh','zrsm'],
      tableData:[
        {xingming:'',bumen:'',xmjs:'',lxdh:'',zrsm:''}
      ]
    }
  },
  props:{
    selectRow:{
      type: Object,
      default: ()=>{}
    }
  },
  watch:{
    selectRow:{
      handler(val) {
        if(this.selectRow){
          this.ruleForm.xmmc = this.selectRow.workName
          this.ruleForm.xmlx = this.selectRow.planEnd
          this.ruleForm.fzr = this.selectRow.schedule
          this.ruleForm.xmbm = this.selectRow.status
        }
      },
      immediate: true,
    }
  },
  methods:{
    handleClick(){}
  }
}
</script>

<style scoped lang="scss">
.xmlx ::v-deep{
  .el-tabs__header {
    margin: 0;
  }
  .el-tabs__content {
    padding-top: 20px;
  }
  .el-input__inner {
    border: 0 !important;
    border-bottom: 1px solid #DCDFE6 !important;
    border-radius: 0 !important;
    padding-right: 20px !important;
  }
}
.form-small-title{
  border-bottom: solid 2px #C0C4CC;
  padding-bottom: 10px;
}
.form-divider{
  width: 5px;
  height: 26px;
  background: rgb(66, 185, 131);
}
.form-small-font{
  font-size: 19px;
  font-weight: 600;
  color: #303133;
}
</style>
